package com.gzwh.v1.sysapi.server.dinner.impl;

import com.gzwh.v1.sysapi.dao.application.SysAppRegMapper;
import com.gzwh.v1.sysapi.dao.dinner.AskTypeMapper;
import com.gzwh.v1.sysapi.dao.member.MemberMapper;
import com.gzwh.v1.sysapi.server.dinner.DinnerVerificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DinnerVerificationServiceImpl implements DinnerVerificationService {

    @Autowired
    AskTypeMapper askTypeMapper;
    @Autowired
    SysAppRegMapper sysAppRegMapper;
    @Autowired
    MemberMapper memberMapper;

    public boolean veriAppctionByAppid(Long appId, Long userId) {
        boolean status = false;
        //检验应用是否符合
        int count = sysAppRegMapper.getDinnerVerByAppctionId(appId, userId);
        if (!(count > 1))
            return false;
        count = memberMapper.verUserStatus(userId);
        if (count > 1)
            return true;
        return status;
    }

}
